import {getToken} from "@/api/system/video/video";

const appKey = process.env.VUE_APP_KEY
const state = {
  videoToken:''
}

const mutations = {
  SET_VIDEO: (state, videoToken) =>{
    state.videoToken = videoToken
  }
}

const actions = {
  loadVideo({ commit }){
    getToken(appKey).then(res =>{
      const token = res.data.accessToken
      // 存储到 Store 中
      commit('SET_VIDEO', token)
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

